#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#

logauth = {"auths": False}

def auth(func):

    def wrapper(*args, **kwargs):
        if logauth["auths"]:
            res = func(*args, **kwargs)
            return res

        username = input("请输入用户名: ")
        password = input("请输入密码: ")
        if username == "xiong" and password == "123":
            res = func(*args, **kwargs)
            logauth["auths"] = True
            return res
        return "登陆失败"

    return wrapper


@auth  # login=auth(login)
def login():
    return "欢迎进入首页!"


@auth
def home():
    return "欢迎进入home页"


print(login())
print(home())
